function bciSaveTrainSet(saveName,runs)
% saveTrainSet(saveName,runs)
% saves a train set
% do not specify runs, if you want to save a global train set last used by
% retraining

global GLOBALtrainSet;
global GLOBALtrainDat;
global GLOBALbci;

if nargin<2,
    if isempty(GLOBALtrainSet),
        error('No global train set found. Define Runs or use retrainClassifier parameter.');
    end
    Train=GLOBALtrainSet;
    bci=GLOBALbci;
else
    [bci,Train]=bciGetTrainDat(GLOBALbci,GLOBALtrainDat{runs});
end

save(saveName,'bci','Train');